package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AdvertisingMapper;
import com.ruoyi.system.domain.Advertising;
import com.ruoyi.system.service.IAdvertisingService;

/**
 * 广告管理Service业务层处理
 * 
 * @author 墨染
 * @date 2024-10-11
 */
@Service
public class AdvertisingServiceImpl implements IAdvertisingService 
{
    @Autowired
    private AdvertisingMapper advertisingMapper;

    /**
     * 查询广告管理
     * 
     * @param advertisingId 广告管理主键
     * @return 广告管理
     */
    @Override
    public Advertising selectAdvertisingByAdvertisingId(Long advertisingId)
    {
        return advertisingMapper.selectAdvertisingByAdvertisingId(advertisingId);
    }

    /**
     * 查询广告管理列表
     * 
     * @param advertising 广告管理
     * @return 广告管理
     */
    @Override
    public List<Advertising> selectAdvertisingList(Advertising advertising)
    {
        return advertisingMapper.selectAdvertisingList(advertising);
    }

    @Override
    public List<Advertising> advertisingList()
    {
        return advertisingMapper.advertisingList();
    }

    /**
     * 新增广告管理
     * 
     * @param advertising 广告管理
     * @return 结果
     */
    @Override
    public int insertAdvertising(Advertising advertising)
    {
        advertising.setCreateTime(DateUtils.getNowDate());
        return advertisingMapper.insertAdvertising(advertising);
    }

    /**
     * 修改广告管理
     * 
     * @param advertising 广告管理
     * @return 结果
     */
    @Override
    public int updateAdvertising(Advertising advertising)
    {
        advertising.setUpdateTime(DateUtils.getNowDate());
        return advertisingMapper.updateAdvertising(advertising);
    }

    /**
     * 批量删除广告管理
     * 
     * @param advertisingIds 需要删除的广告管理主键
     * @return 结果
     */
    @Override
    public int deleteAdvertisingByAdvertisingIds(Long[] advertisingIds)
    {
        return advertisingMapper.deleteAdvertisingByAdvertisingIds(advertisingIds);
    }

    /**
     * 删除广告管理信息
     * 
     * @param advertisingId 广告管理主键
     * @return 结果
     */
    @Override
    public int deleteAdvertisingByAdvertisingId(Long advertisingId)
    {
        return advertisingMapper.deleteAdvertisingByAdvertisingId(advertisingId);
    }
}
